<?php session_start();?>
<script LANGUAGE="javascript">
function redirectPageComplete()
{	
	alert("แก้ไขชื่ออัลบั้มสำเร็จ");
	window.returnValue = "OK";
	window.close();
	
}
function redirectPageInComplete()
{	
	alert("เกิข้อผิดพลาดในการแก้ไขชื่ออัลบั้ม");
	window.returnValue = "Cancel";
	window.close();
}
<?php 
include '../../../dbconfig.php';
$albumId =  $_POST['album_id'] ;
$albumName = $_POST['album_name'] ;
$albumDescription = $_POST['album_description'] ;
$albumPhotographer = $_POST['album_photographer'] ;
$modified_mid = $_SESSION['uid'];
$modified_datetime = date("YmdHis");

if(isset($albumId,$albumName,$albumPhotographer)){
	$sql = "SELECT * FROM album WHERE album_id=".$albumId;
	$sql = mysql_query($sql);
	$row = mysql_fetch_array($sql);
	$sql = "UPDATE album
			SET album_name = '$albumName',
			album_description = '$albumDescription',
			album_photographer = '$albumPhotographer',
			modified_master_id = '$modified_mid',
			modified_date_time = '$modified_datetime' 
			WHERE album_id= $albumId";
	if(mysql_query($sql)){
		rename("../../../images/uploads/".$row['album_id']."_".iconv("UTF-8","windows-874",$row['album_name']), "../../../images/uploads/".$albumId."_".iconv("UTF-8","windows-874",$albumName));
		echo "redirectPageComplete();";
	}else{
		echo "redirectPageInComplete();";
	}	
}
?>
</script>